<?php
namespace app\index\controller;
use think\Controller;
class Index extends Controller{
  public function index(){
  	//推荐房源
  	foreach(model('Pub')->alias('p')->join('Village v','v.id=p.vill')->where(['ispub'=>1])->limit(0,3)->order('p.pid desc')->select() as $val){
  		$data[] = $val->toArray();
  	}
  	$this->assign('data',$data);

  	//轮播
  	foreach(model('Lunbo')->select() as $val){
  		$lbs[] = $val->toArray();
  	}
  	$this->assign('lbs',$lbs);

    return $this->fetch();
  }

 

}
